
class  Animal(object):
    def speak(self):
        print("Animal speak")

class Dog(Animal):
    def speak(self):
        print("Dog speak")

class Cat(Animal):
    def speak(self):
        print("Cat speak")


def animalSpeak(animal):
    animal.speak()

if __name__ == '__main__':
    dog = Dog()
    cat = Cat()
    animalSpeak(dog)
    animalSpeak(cat)